# Lucid is (C) Copyright 2006-2007 by Infiscape Corporation
#
# This file is part of Lucid, a PyOpenSG example application.
#
# Lucid is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Lucid is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program.  If not, see <http://www.gnu.org/licenses/>.

from PyQt4 import QtGui, QtCore
import osg2
import lucid.core
import lucid.core.plugin_interfaces
from pydispatch import dispatcher

class BoxCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create box.  """
   def __init__(self):
      super(BoxCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Box"
   
   @staticmethod
   def createGraph():
      return osg2.makeBox(1.0,1.0,1.0,
                          1,1,1)

class PlaneCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create plane.  """
   def __init__(self):
      super(PlaneCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Plane"
   
   @staticmethod
   def createGraph():
      return osg2.makePlane(1.0, 1.0, 40, 40)

class ConeCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create cone.  """
   def __init__(self):
      super(ConeCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Cone"
   
   @staticmethod
   def createGraph():
      return osg2.makeCone(1,1,10,True,True)


class CylinderCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create cylinder.  """
   def __init__(self):
      super(CylinderCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Cylinder"
   
   @staticmethod
   def createGraph():
      return osg2.makeCylinder(1.0, 1.0, 10,
                               True,True,True)

class TorusCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create torus.  """
   def __init__(self):
      super(TorusCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Torus"
   
   @staticmethod
   def createGraph():
      return osg2.makeTorus(1.0,2.0,20,20)


class SphereCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create sphere.  """
   def __init__(self):
      super(SphereCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Sphere"
   
   @staticmethod
   def createGraph():
      return osg2.makeSphere(10,1)
   

class LatLongSphereCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create ll sphere.  """
   def __init__(self):
      super(LatLongSphereCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Sphere (Lat/Long)"
   
   @staticmethod
   def createGraph():
      return osg2.makeLatLongSphere(10,10,1.0)


class ConicalFrustumCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create frustum.  """
   def __init__(self):
      super(ConicalFrustumCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Conical Frustum"
   
   @staticmethod
   def createGraph():
      return osg2.makeConicalFrustum(1.0,1.0,1.0,4,
                                     True,True,True)


class TeapotCreator(lucid.core.plugin_interfaces.IGraphCreatorPlugin):
   """ Create frustum.  """
   def __init__(self):
      super(TeapotCreator, self).__init()
   
   @staticmethod
   def getName():
      return "Teapot"
   
   @staticmethod
   def createGraph():
      return osg2.makeTeapot(5)

   
   
